package com.jweb.framework.core.service.sqlmap;

import java.util.List;

import org.apache.ibatis.session.ResultHandler;
import org.springframework.dao.DataAccessException;

/**
 * 修改人： Thomas  
 * 修改内容：新增 类说明：操作数据接口
 */
public interface SqlMap {

	public <T> T queryForObject(String paramString) throws DataAccessException;

	public <T> T queryForObject(String paramString, Object paramObject)
			throws DataAccessException;

	/** 单条数据查询+EhCache */
	public <T> T queryForObjectEhCache(String sql) throws DataAccessException;

	public <T> T queryForObjectEhCache(final String sql, final Object obj)
			throws DataAccessException;

	public <T> List<T> queryForList(String paramString)
			throws DataAccessException;

	public <T> List<T> queryForList(String paramString, Object paramObject)
			throws DataAccessException;

	public <T> List<T> queryForList(String paramString, Object paramObject,
			int paramInt1, int paramInt2) throws DataAccessException;

	/** 多条数据查询+EhCache */
	public <T> List<T> queryForListEhCache(String sql)
			throws DataAccessException;

	public <T> List<T> queryForListEhCache(final String sql, final Object obj)
			throws DataAccessException;

	/*
	 * public <K, V> Map<K, V> queryForMap(String paramString1, String
	 * paramString2) throws DataAccessException;
	 * 
	 * public <K, V> Map<K, V> queryForMap(String paramString1, Object
	 * paramObject, String paramString2) throws DataAccessException;
	 * 
	 * public <K, V> Map<K, V> queryForMap(String paramString1, String
	 * paramString2, int paramInt1, int paramInt2) throws DataAccessException;
	 * 
	 * public <K, V> Map<K, V> queryForMap(String paramString1, Object
	 * paramObject, String paramString2, int paramInt1, int paramInt2) throws
	 * DataAccessException;
	 */

	public void queryWithRowHandler(String paramString, Object paramObject,
			ResultHandler paramResultHandler) throws DataAccessException;

	public void queryWithRowHandler(String paramString, Object paramObject,
			int paramInt1, int paramInt2, ResultHandler paramResultHandler)
			throws DataAccessException;

	public int insert(String paramString) throws DataAccessException;

	public int insert(String paramString, Object paramObject)
			throws DataAccessException;
	
	/**数据插入 + EhCache*/
	public int insertEhCache(String sql) throws DataAccessException ;
	
	public int insertEhCache(final String sql , final Object obj) throws DataAccessException ;

	public int update(String paramString) throws DataAccessException;

	public int update(String paramString, Object paramObject)
			throws DataAccessException;

	public void update(String paramString, Object paramObject, int paramInt)
			throws DataAccessException;
	
	/**数据更新 + EhCache*/
	public int updateEhCache(String sql) throws DataAccessException ;
	
	public int updateEhCache(final String sql , final Object obj) throws DataAccessException ;
	
	public void updateEhCache( String sql ,  Object obj, int requiredRowsAffected) throws DataAccessException ;

	public int delete(String paramString) throws DataAccessException;

	public int delete(String paramString, Object paramObject)
			throws DataAccessException;

	public void delete(String paramString, Object paramObject, int paramInt)
			throws DataAccessException;
	
	/**数据删除 + EhCache*/
	public int deleteEhCache(String sql) throws DataAccessException ;
	
	public int deleteEhCache(final String sql , final Object obj) throws DataAccessException ;
	
	public void deleteEhCache(String sql , Object obj , int requiredRowsAffected) throws DataAccessException ;

}
